<?php

namespace App\Models\Vote;

use Illuminate\Database\Eloquent\Model;

/**
 * Class VoteSubject
 * @property  views
 * @package App\Models\Vote\VoteSubject
 */
class VoteSubject extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'vote_subjects';

    public function setChoicesAttribute($choices)
    {
        $this->attributes['choices'] = json_encode($choices);
    }

    public function getChoicesAttribute()
    {
        return  json_decode($this->attributes['choices']);
    }

}
